* This file: ./replication/run-do-files.do

* Replication files for:
* Iversen, Torben, and Philipp Rehm. forthcoming. “Information and Financialization: Credit Markets as a New Source of Inequality.” Comparative Political Studies.
* November 22, 2021
* Email: philipp.rehm@gmail.com


* Change the following path the location of the replication files folder
cd ./replication/

* Figure 1
cd ./figure_1/
do figure_1.do
cd ..

/*
* Data for Figures 2 to 6 
* Need to download data from Freddie Mac’s "Single Family Loan-Level Dataset" (http://www.freddiemac.com/research/datasets/sf_loanlevel_dataset.page, last accessed June 3, 2021 [https://perma.cc/KU32-9TXH]), Q1-1999 to Q4-2019
cd ./figures_2_3_4_5_6/
cap log close
log using data_for_figures_2_3_4_5_6_logfile.txt, text
di "** Current date **"
di "`= c(current_date)'"
about
which rdrobust
do data_for_figures_2_3_4_5_6.do
cap log close
cd ..
pwd
*/

* Figures 2 to 6
cd ./figures_2_3_4_5_6/
pwd
cap log close
log using figures_2_3_4_5_6_logfile.txt, text
di "** Current date **"
di "`= c(current_date)'"
about
which rdrobust
do figures_2_3_4_5_6.do
cap log close
cd ..
pwd

* Figure C10
* Figure C10 is based on data from the European Foundation for the Improvement of Living and Working Conditions (2018). European Quality of Life Survey Integrated Data File, 2003-2016. [data collection]. 3rd Edition. UK Data Service. SN: 7348, http://doi.org/10.5255/UKDA-SN-7348-3, http://doi.org/10.5255/UKDA-SN-7348-3.
* These data are safeguarded (https://ukdataservice.ac.uk/find-data/access-conditions/safeguarded-access/). To gain access to the data, please register an account with the UK Data Archive (https://ukdataservice.ac.uk/).
cd ./figure_c10/
pwd
cap log close
log using figure_c10_eqls_logfile.txt, text
di "** Current date **"
di "`= c(current_date)'"
about
do figure_c10_eqls.do
cd ..
pwd 

* Table 1, Tables D6 to D14
* -> see .\replication\figures_2_3_4_5_6\figures_2_3_4_5_6.do

* Table 2
cd ./table_2/
pwd
cap log close
log using table_2_evs_logfile.txt, text
di "** Current date **"
di "`= c(current_date)'"
about
do table_2_evs.do
cap log close
cd ..
pwd

/*
* Tables 3 to 5
* The article uses SOEP-Core, v35i (International Version, 95%), doi:10.5684/soep-core.v35i
* You need to apply for access to the SOEP dataset at https://www.diw.de/en/diw_01.c.601584.en/data_access.html
cd ./tables_3_4_5/
pwd
cap log close
log using tables_3_4_5_gsoep_logfile.txt, text
di "** Current date **"
di "`= c(current_date)'"
about
do tables_3_4_5_gsoep.do
cap log close
cd ..
pwd
*/

* Table E15
cd ./table_e15/
pwd
cap log close
log using table_e15_correlation_matrix_logfile.txt, text
di "** Current date **"
di "`= c(current_date)'"
about
do table_e15_correlation_matrix.do
cap log close
cd ..
pwd

